module Main where

import Graphics.UI.WX

------------------------------------------------------------------------

main :: IO ()
main = start helloFrame

helloFrame :: IO ()
helloFrame =
  do frm <- frame      [ text := "Greetings" ]
     nam <- entry  frm []
     grt <- staticText frm [ ]
     hel <- button frm [ text := "Hello", on command := hello nam grt ]
     set nam [ on command := hello nam grt ]
     set frm [ layout :=
                 column 3 $ map floatCenter $
                 [ widget nam
                 , widget hel
                 , widget grt
                 ]
             ]

------------------------------------------------------------------------

hello :: TextCtrl () -> StaticText () -> IO ()
hello nam grt =
  do s <- get nam text
     set grt [ text := ("Hello, " ++ s ++ "!") ]

------------------------------------------------------------------------
